﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="/static/css/sweetalert.min.css" />
    <link rel="stylesheet" href="/static/css/common/reset.css" />
    <link rel="stylesheet" href="/static/css/register.css" />
    <link rel="stylesheet" href="/static/css/jquery-validate.css" />
    <style>
        label .error {
            color: #ff0000;
            padding: 0 6px;
        }
    </style>
    <title>社团注册</title>
</head>
<body>
    <div class="register">
        <header class="warp">
            <div class="main header clearfix">
                <div class="logo fl"><img src="/static/images/logo.png" alt=""></div>
                <div class="type fl">
                    <h2>社 团</h2>
                </div>
                <div class="f22 ml20 pt25 fl">欢迎注册</div>
                <p class="reg-login fr">已经注册，马上<a href="/login.html">登录</a></p>
            </div>
        </header>
        <section class="warp mt20">

            <div class="main regWidth reg-content">
                <ul class="reg-c-ul clearfix">
                    <li class="active">
                        <a href="javascript:void(0)"><span>1</span>设置登录名</a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <span>2</span>设置负责人信息
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <span>3</span>设置社团信息
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <span>4</span>设置账号信息
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)">
                            <span>5</span>等待审核
                        </a>
                    </li>
                </ul>
                <div class="reg-tab">
                    <form id="firstStepForm" class="">
                        <div class="reg-t-loginName ">
                            <p class="colorRed f14 textcenter">注册宾果高校，请绑定常用手机号码作为登录名</p>
                            <div class="form_control">
                                <input class="reg-tlogin-tel mt5 required" data-tip="请输入您的手机" data-valid="isNonEmpty||isMobile" data-error="手机不能为空||手机格式不正确" type="text" placeholder="请输入您的手机号码" name="UserName" id="UserName" data-rule-mobile="true" />
                            </div>
                            <div class="reg-t-code clearfix mt20">
                                <div class="form_control veriCode">
                                    <input type="text" class="for-gCode-input code fl" placeholder="请输入图片验证码" required name="vcode" id="vcode" />
                                </div>
                                <img id="valiCode" class="codeImg" src="/api/login/GetValidateCode" alt="验证码" />

                            </div>
                            <div class="reg-t-code clearfix mt20">
                                <div class="form_control veriCode">
                                    <input type="text" class="hide" value="Student" name="Role" id="Role" />
                                    <input type="text" class="required" data-tip="请输入验证码" data-valid="isNonEmpty" data-error="验证码不能为空" placeholder="请输入验证码" name="NickName" id="NickName" />
                                </div>
                                <a href="javascript:void(0)" id="getAuditcode">获取验证码</a>
                            </div>
                            <div class="reg-t-inputText mt20 clearfix">
                                <a href="javascript:void(0)" class="">输入密码</a>
                                <div class="form_control">
                                    <input type="password" class="required" data-tip="请输入密码" data-valid="isNonEmpty||between:6-16" data-error="密码不能为空||密码长度6-16位" placeholder="请输入密码" id="password" name="password" />
                                </div>
                            </div>
                            <div class="reg-t-inputText mt20">
                                <a href="javascript:void(0)" class="">确认密码</a>
                                <div class="form_control">
                                    <input type="password" class="required" data-tip="请确认密码" data-valid="isNonEmpty||comparePwd:password" data-error="密码不能为空||密码不一致" placeholder="请确认密码" id="password2" name="password2" />
                                </div>
                            </div>
                            <a href="javascript:void(0)" class="reg-t-nextBtn mt20" id="firstStep">下一步</a>
                            <a href="/company/register.html" class="mt5">企业用户注册 ></a><br />
                            <a href="/agent/register.html" class="mt5">代理官注册 ></a>
                        </div>
                    </form>

                    <form id="secondStepForm" class="hide">
                        <div class="reg-t-communityName">
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>社团名称：</label>
                                <div class="form_control">
                                    <input type="text" class="required" data-tip="请输入社团名称" data-valid="isNonEmpty" data-error="社团名称不能为空" placeholder="请输入社团名称" value="" name="name" />
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>社团口号：</label>
                                <div class="form_control">
                                    <input type="text" class="" data-tip="请输入社团口号" data-valid="isNonEmpty" data-error="社团口号不能为空" placeholder="请输入社团口号" value="" name="Remark" />
                                    <span class="notmust">（选填）</span>
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 charge clearfix">
                                <label>社团负责人：</label>
                                <div class="form_control">
                                    <input type="text" class="required" data-tip="请输入社团负责人" data-valid="isNonEmpty" data-error="社团负责人不能为空" placeholder="请输入社团负责人" value="" name="belongName" />
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>社团级别：</label>
                                <div class="form_control">
                                    <select style="width: 207px;" class="required" data-valid="isNonEmpty" data-tip="请选择院校级" data-error="请选择院校级" name="nature">
                                        <option value="">请选择院校级</option>
                                        <option value="900000001">校级</option>
                                        <option value="900000002">院级</option>
                                    </select>
                                </div>
                            </div>

                            <div class="reg-tcom-item mt10 communityType clearfix">
                                <label>社团类型：</label>
                                <div class="form_control">
                                    <select name="type" class="required" data-valid="isNonEmpty" data-tip="请选择社团" data-error="请选择社团" id="type" onchange="changeType(this.value)">
                                        <option value="">请选择社团分类</option>
                                        <option value="900000112">组织类</option>
                                        <option value="900000113">社团类</option>
                                    </select>
                                </div>
                                <div class="form_control">
                                    <select name="typedetail" class="required" data-valid="isNonEmpty" data-tip="请选择社团名称" data-error="请选择社团名称" id="typedetail">
                                        <option value="">请选择社团名称</option>
                                    </select>
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>社团规模：</label>
                                <div class="form_control">
                                    <select style="width: 207px;" class="required" data-valid="isNonEmpty" data-tip="请选择社团规模" data-error="请选择社团规模" name="amount" id="amount">
                                        <option value="">请选择社团规模</option>
                                    </select>
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>部门数量：</label>
                                <div class="form_control">
                                    <input type="text" class="required" data-valid="isNonEmpty" data-tip="请输入部门数量" data-error="请输入部门数量" placeholder="请输入部门数量" value="" name="deptAmount" />
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>学校地址：</label>
                                <div class="form_control">
                                    <input type="text" class="required" data-valid="isNonEmpty" data-tip="请输入学校地址" data-error="请输入学校地址" placeholder="请输入学校地址" value="" name="schoolAddress" />
                                </div>
                            </div>
                            <div class="reg-tcom-upload mt20 clearfix">
                                <div class="fl reg-tcupload-img">
                                    <img id="inputImg" src="/static/images/community1.png" />
                                </div>
                                <div class="fr reg-tcupload-tips">
                                    <a href="javascript:void(0)" class="reg-tauLeft-btn" name="">
                                        <div class="form_control file">
                                            <input type="file" data-valid="isNonEmpty" data-tip="请上传图片" data-error="请上传图片" name="StuIDCardContent" class="reg-tauLeft-btnInput required" id="regInputFile" />
                                            社团logo
                                        </div>
                                    </a>
                                    <p></p>
                                    <p class="colorWhite mt10 colorWhite colorLGray">※上传LOGO图片格式 为.jpg， 大小不能超过1M。</p>
                                </div>
                            </div>
                            <a href="javascript:void(0)" class="reg-t-nextBtn mt30" id="secondStep">下一步</a>
                            <p class="mt5 textcenter" onclick="preStep(2)">返回上一步 ></p>
                        </div>
                    </form>
                    <form id="thirdStepForm" class="hide">

                        <div class="ref-t-charge ">
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>姓名：</label>
                                <div class="form_control">
                                    <input type="text" class="required" data-tip="请输入姓名" data-valid="isNonEmpty" data-error="姓名不能为空" placeholder="请输入姓名" value="" name="name" />
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 school clearfix">
                                <label>所属学校：</label>
                                <div class="form_control">
                                    <select class="required" data-tip="请选择所属学校" data-valid="isNonEmpty" data-error="请选择所属学校">
                                        <option>广东省</option>
                                    </select>
                                </div>
                                <div class="form_control">
                                    <select id="city" class="required" data-tip="请选择城市" data-valid="isNonEmpty" data-error="请选择城市" onchange="changeCity(this.value)">
                                        <option>选择城市</option>
                                    </select>
                                </div>
                                <div class="form_control">
                                    <select name="school" class="required" data-tip="请选择高校" data-valid="isNonEmpty" data-error="请选择高校" id="schoolNO">
                                        <option value="">选择高校</option>
                                    </select>
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>院系：</label>
                                <div class="form_control">
                                    <input type="text" class="required" data-valid="isNonEmpty" data-tip="请输入院系" data-error="院系不能为空" placeholder="请输入院系" value="" name="Major" />
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 charge clearfix">
                                <label>入学年份：</label>
                                <div class="form_control">
                                    <select style="width: 194px;" class="required" data-tip="请选择入学年份" data-valid="isNonEmpty" data-error="请选择入学年份" name="EntranceDate">
                                        <option value="2017-09-01 00:00:00">2017年</option>
                                        <option value="2016-09-01 00:00:00">2016年</option>
                                        <option value="2015-09-01 00:00:00">2015年</option>
                                        <option value="2014-09-01 00:00:00">2014年</option>
                                        <option value="2013-09-01 00:00:00">2013年</option>
                                        <option value="2012-09-01 00:00:00">2012年</option>
                                        <option value="2011-09-01 00:00:00">2011年</option>
                                        <option value="2010-09-01 00:00:00">2010年</option>
                                        <option value="2009-09-01 00:00:00">2009年</option>
                                        <option value="2008-09-01 00:00:00">2008年</option>
                                    </select>
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>学历：</label>
                                <div class="form_control">
                                    <select name="Education" class="required" data-tip="请选择学历" data-valid="isNonEmpty" data-error="请选择学历">
                                        <option value="">请选择学历</option>
                                        <option value="大专">大专</option>
                                        <option value="本科">本科</option>
                                        <option value="研究生">研究生</option>
                                        <option value="博士生">博士生</option>
                                    </select>
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>学号：</label>
                                <div class="form_control">
                                    <input type="text" class="required" data-valid="isNonEmpty||onlyInt" data-tip="请输入学号" data-error="学号不能为空||学号格式不正确" placeholder="请输入学号" value="" name="StudentLDNO" data-rule-number="true" />
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>手机：</label>
                                <div class="form_control">
                                    <input type="tel" class="required" data-valid="isNonEmpty||isMobile" data-tip="请输入手机" data-error="手机不能为空||手机格式不正确" placeholder="请输入手机" value="" name="phone" data-rule-mobile="true" />
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>QQ：</label>
                                <div class="form_control">
                                    <input type="text" class="required" data-valid="isNonEmpty||onlyInt" data-tip="请输入QQ" data-error="QQ不能为空||QQ格式不正确" placeholder="请输入QQ" value="" name="qq" data-rule-number="true" />
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>微信：</label>
                                <div class="form_control">
                                    <input type="text" class="" data-valid="isNonEmpty" data-tip="请输入微信" data-error="微信不能为空" placeholder="请输入微信" value="" name="wechart" />
                                    <span class="notmust">（选填）</span>
                                </div>
                            </div>
                            <div class="reg-tcom-item mt10 clearfix">
                                <label>邮箱：</label>
                                <div class="form_control">
                                    <input type="text" class="required" data-valid="isNonEmpty||isEmail" data-tip="请输入邮箱" data-error="邮箱不能为空||邮箱格式不正确" placeholder="请输入邮箱" value="" name="email" data-rule-email="true" />
                                </div>
                            </div>
                            <a href="javascript:void(0)" class="reg-t-nextBtn mt30" id="thirdStep">下一步</a>
                        </div>
                    </form>

                    <form id="fourthStepForm" class="hide">
                        <div class="">

                            <div class="reg-t-account">
                                <p class="colorRed mt30">请社团负责人上传学生证的正反面照片</p>
                                <div class="reg-tAccount-uploadBtns clearfix">
                                    <div class="reg-taUploadBtns-left fl" id="reg-taUploadBtns-left">
                                        <!-- <a href="javascript:void(0)" class="reg-tauLeft-btn">
                                            身份证正面上传
                                            <div class="form_control file">
                                                <input type="file" data-valid="isNonEmpty" data-tip="请上传身份证正面" data-error="请上传身份证正面" name="IDFront" class="reg-tauLeft-btnInput required regInchargeFile"  />
                                            </div>
                                            <p class="reg-tauLeft-text">未上传</p>
                                        </a>
                                        <a href="javascript:void(0)" class="reg-tauLeft-btn" name="">
                                            身份证反面上传
                                            <div class="form_control file">
                                                <input type="file" data-valid="isNonEmpty" data-tip="请上传身份证反面" data-error="请上传身份证反面" name="IDOpposite" class="reg-tauLeft-btnInput required regInchargeFile"  />
                                            </div>
                                            <p class="reg-tauLeft-text">未上传</p>
                                        </a> -->
                                        <a href="javascript:void(0)" class="reg-tauLeft-btn" name="">
                                            学生证封面上传
                                            <div class="form_control file">
                                                <input type="file" data-valid="isNonEmpty" data-tip="请上传学生证封面" data-error="请上传学生证封面" name="StuIDCardContent" class="reg-tauLeft-btnInput required regInchargeFile" />
                                            </div>
                                            <p class="reg-tauLeft-text">未上传</p>
                                        </a>
                                        <a href="javascript:void(0)" class="reg-tauLeft-btn" name="">
                                            学生证内页上传
                                            <div class="form_control file">
                                                <input type="file" data-valid="isNonEmpty" data-tip="请上传学生证内页" data-error="请上传学生证内页" name="StuIDCardCover" class="reg-tauLeft-btnInput required regInchargeFile" />
                                            </div>
                                            <p class="reg-tauLeft-text">未上传</p>
                                        </a>
                                    </div>
                                    <div class="reg-taUploadBtns-right fr">
                                        <p class="pl5">请根据提供规范上传个人证件照片</p>
                                        <ul class="reg-tauRight-ul clearfix mt10" id="reg-tauRight-ul">
                                            <!-- <li><img src="/static/images/register3.png" /></li>
                                            <li><img src="/static/images/register5.png" /></li> -->
                                            <li><img src="/static/images/register6.png" /></li>
                                            <li><img src="/static/images/register7.png" /></li>
                                        </ul>
                                    </div>
                                </div>

                                <p class="colorRed mt30">填写身份证、支付宝、银行卡账号是为了验证用户真实性，同时提高支付环节安全性保障。</p>
                                <p class="colorRed">社团负责人私密信息宾果严格为您保密,请放心填写</p>
                                <div class="reg-tAcc-inputText mt20 clearfix">
                                    <a href="javascript:void(0)" class="" name="PersonCardNo">身份证号码</a>
                                    <div class="form_control">
                                        <input type="text" class="" data-valid="isNonEmpty||checkIdcard" data-tip="请输入身份证号" data-error="身份证不能为空||身份证格式不正确" value="" placeholder="请填写社团负责人身份证号" name="LDID" />
                                        <span class="notmust">（选填）</span>
                                    </div>
                                </div>
                                <div class="reg-tAcc-inputText mt20 clearfix">
                                    <a href="javascript:void(0)" class="" name="AliPayNo">支付宝账号</a>
                                    <div class="form_control">
                                        <input type="text" class="" data-valid="isNonEmpty" data-tip="请输入支付宝账号" data-error="支付宝账号不能为空" placeholder="请填写社团负责人支付宝账号" name="AliPayNo" />
                                        <span class="notmust">（选填）</span>
                                    </div>
                                </div>
                                <div class="reg-tAcc-inputText mt20 clearfix">
                                    <a href="javascript:void(0)" class="">银行卡账号</a>
                                    <div class="form_control">
                                        <input type="text" class="" data-valid="isNonEmpty||checkBankCard" data-tip="请输入银行卡账号" data-error="银行卡账号不能为空||银行卡账号格式不正确" placeholder="请填写社团负责人银行卡账号" name="BankNo" />
                                        <span class="notmust">（选填）</span>
                                    </div>
                                </div>
                                
                            </div>
                            <div class="reg-taUploadNext">
                                <div class="reg-tAccount-next">
                                    <div class="textcenter mt10">

                                        <input type="checkbox" name="Agree" value="" class="reg-tamount-tips" id="reg-tamount-tips" />同意<a href="javascript:void(0)" class="reg-tamount-risk colorBlue" id="reg-tamount-risk">《宾果用户章程》</a>
                                    </div>
                                    <a href="javascript:void(0)" class="reg-taUploadRight" id="fourthStep">确认填写，进入审核</a>

                                    <p class="mt5 textcenter" onclick="preStep(3)">返回上一步 ></p>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="reg-t-verify hide" id="complate">
                        <img src="/static/images/register4.png" class="reg-tVerify-img" />
                        <p class="colorRed f24 mt10">您的注册申请我们已经提交至后台进行信息审核</p>
                        <p class="f18 mt10">宾果将在自您确定提交信息后的24小时内进行人工审核，并将审核结果以短信形式发送至您手机上，耐心等候。</p>
                    </div>

                </div>
            </div>
        </section>
        <div id="divFooter"></div>
    </div>
    <!--遮罩层-->
    <div class="mask hide"></div>
    <!-- 宾果章程 -->
    <div id="rulesDetails"></div>
    <script src="/static/js/ref/jquery-2.1.1.min.js"></script>
    <script src="/static/js/self/common.js"></script>
    <script src="/static/js/ref/linq.min.js"></script>
    <script src="/static/js/ref/sweetalert.min.js"></script>
    <script src="/static/js/ref/sha512.js"></script>
    <script src="/static/js/self/util.js"></script>
    <script src="/static/js/self/jquery-validate.js"></script>
    <script>
        common.validator($('form'));
        $("#divFooter").load("/wuc/footer.html");
        //设置个人信息选择文件
        $("#regInputFile").on(' change', function () {

            /*var filePath = this.files;
            var files_val = '';
            files_val = "已上传：" + filePath[0].name;
            console.log(filePath);
            this.parentElement.parentElement.nextElementSibling.innerHTML = files_val;*/

            var $file = $(this);
            var fileObj = $file[0];

            var fName = this.value;
            var fileSize = (fileObj.files[0].size / 1024).toFixed(1);
            if (!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(fName)) {
                alert("图片类型必须是.gif,jpeg,jpg,png中的一种")
                return false;
            } else if (fileSize > 1024) {
                alert("图片不能大于1M")
                return false;
            }

            var windowURL = window.URL || window.webkitURL;
            var dataURL;
            var $img = $("#inputImg");
            if (fileObj && fileObj.files && fileObj.files[0]) {
                dataURL = windowURL.createObjectURL(fileObj.files[0]);
                $img.attr('src', dataURL);
            } else {

                dataURL = $file.val();
                var imgObj = document.getElementById("inputImg");
                // 两个坑:
                // 1、在设置filter属性时，元素必须已经存在在DOM树中，动态创建的Node，也需要在设置属性前加入到DOM中，先设置属性在加入，无效；
                // 2、src属性需要像下面的方式添加，上面的两种方式添加，无效；
                imgObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                imgObj.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = dataURL;

            }

        });
        //设置账号信息选择文件
        $("#reg-taUploadBtns-left .regInchargeFile").on(' change', function () {

            /*var filePath = this.files;
            var files_val = '';
            files_val = "已上传：" + filePath[0].name;
            console.log(filePath);
            this.parentElement.parentElement.nextElementSibling.innerHTML = files_val;*/

            var $file = $(this);
            var index_ = $file.parent().parent().index();
            var li_ = $("#reg-tauRight-ul li");
            var fileObj = $file[0];
            var fileVal = fileObj.files[0].name;

            var fileSize = (fileObj.files[0].size / 1024).toFixed(1);
            if (!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(fileVal)) {
                alert("图片类型必须是.gif,jpg,jpeg,png,GIF,JPG,PNG中的一种")
                return false;
            } else if (fileSize > 1024) {
                alert("图片不能大于1M")
                return false;
            }

            var windowURL = window.URL || window.webkitURL;
            var dataURL;
            if (fileObj && fileObj.files && fileObj.files[0]) {
                dataURL = windowURL.createObjectURL(fileObj.files[0]);
                li_.eq(index_).find("img").attr('src', dataURL);
                this.parentElement.nextElementSibling.innerHTML = '已上传：' + fileObj.files[0].name;
            } else {

                dataURL = $file.val();
                var imgObj = document.getElementById("reg-tauRight-ul");
                var li_ = imgObj.getElementByTagName('li');
                // 两个坑:
                // 1、在设置filter属性时，元素必须已经存在在DOM树中，动态创建的Node，也需要在设置属性前加入到DOM中，先设置属性在加入，无效；
                // 2、src属性需要像下面的方式添加，上面的两种方式添加，无效；
                li_[index_].childNodes[0].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                li_[index_].childNodes[0].filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = dataURL;

            }

        });

        $("#valiCode").bind("click", function () {
            this.src = "/api/Login/GetValidateCode?time=" + (new Date()).getTime();
        });

        common.ValidateFormJQ('fourthStepForm', 'fourthStep', submitFourthStep)
        common.ValidateFormJQ('thirdStepForm', 'thirdStep', submitThirdStep)
        common.ValidateFormJQ('secondStepForm', 'secondStep', submitSecondStep)
        common.ValidateFormJQ('firstStepForm', 'firstStep', submitFirstStep)
        function submitFourthStep() {

            if (document.getElementById("reg-tamount-tips").checked) {
                common.FormAjax({ type: 'Post', url: '/api/Student/RegisterFourth', ID: "fourthStepForm", sMethod: AfterAjax });
            } else {
                alert("请阅读并确认宾果章程");
            }

        };
        function submitThirdStep() {
            common.FormAjax({ type: 'Post', url: '/api/Student/RegisterThird', ID: "thirdStepForm", sMethod: AfterAjax });
        };
        function submitSecondStep() {
            common.FormAjax({ type: 'Post', url: '/api/Student/RegisterSecond', ID: "secondStepForm", sMethod: AfterAjax });
        };
        function submitFirstStep() {
            var values = common.GetCtrlValues({
                ContentID: "firstStepForm"
            })
            common.commonAjax({ type: 'Post', url: '/api/login/post', data: values, sMethod: AfterAjax });
        };
        function AfterAjax(ctx) {


            if (ctx == null) {
                common.alertMessage("无数据.");
                return;
            }

            var str = ctx.ResponseStr.toString();
            switch (str) {
                case "1":
                    hideForm("firstStepForm", 0);
                    break;
                case "3":
                    hideForm("secondStepForm", 2);
                    break;
                case "2":
                    hideForm("thirdStepForm", 1);
                    break;
                case "4":
                    hideForm("fourthStepForm", 3);
                    break;
                case "5":
                    hideForm("complate", 4);
                    break;
                default:
                    common.alertMessage(str);
                    break;
            }

        }
        function preStep(ctx) {
            switch (ctx.toString()) {
                case "1":
                    hideForm("firstStepForm", 0);
                    break;
                case "3":
                    hideForm("secondStepForm", 2);
                    break;
                case "2":
                    hideForm("thirdStepForm", 1);

                    break;
                case "4":
                    hideForm("fourthStepForm", 3);
                    break;
                case "5":
                    hideForm("complate", 4);
                    break;
                default:
                    common.alertMessage(str);
                    break;
            }

        }
        function hideForm(formID, eqnum) {
            $("#secondStepForm").addClass("hide");
            $("#firstStepForm").addClass("hide");
            $("#thirdStepForm").addClass("hide");
            $("#fourthStepForm").addClass("hide");
            $("#complate").addClass("hide");

            $("ul").children("li").removeClass("active");

            $("#" + formID).removeClass("hide");
            for (var i = 0; i <= eqnum; i++) {
                $("ul").children("li").eq(i).addClass("active");
            }
        }
        function AfterCompleted(ctx) {

            if (ctx == null) {

                common.alertMessage("无数据.");
                return;
            }

            window.projectID = ctx.ResponseStr.toString();
            $(".mask").show();
            $("#uploadBox").show();

        }

        function AfteAjaxPhone(ctx) {
            if (ctx == null || ctx == "") {
                common.alertMessage("该手机已注册");
                return;
            }
            else if (ctx == "验证码错误") {
                common.alertMessage("图片验证码错误");
                return;
            }
            timeTick("#getAuditcode", 60, "获取验证码");
            common.alertMessage("验证码已经发出，请注意查收");
        }

        $("#getAuditcode").click(function () {

            var phoneNo = $('#UserName').val();
            var code = $('#vcode').val();
            if (!common.checkValue(phoneNo)) {
                common.alertMessage("请输入手机号码");
                return;
            }
            if (!common.checkValue(code)) {
                common.alertMessage("请输入图片验证码");
                return;
            }
            common.commonAjax({ type: 'Get', url: '/api/login/GetMessage?id=' + phoneNo + '&vcode=' + code, sMethod: AfteAjaxPhone });
        })

        var lstSchool;
        var lstType;
        var lstAmout;

        function ListSchool(ctx) {
            if (ctx == "" || ctx == null) {
                common.alertMessage("提交错误，请重试！");
                return;
            }
            lstSchool = ctx.ResponseList;
        }
        function ListBaseData(ctx) {
            if (ctx == "" || ctx == null) {
                common.alertMessage("提交错误，请重试！");
                return;
            }
            lstType = ctx.ResponseList;
        }
        function ListAmount(ctx) {
            lstAmout = ctx.ResponseList;
            Enumerable.From(lstAmout).ForEach(function (obj) {
                $("#amount").append("<option value='" + obj.RuleNO + "'>" + obj.Description + "</option>")
            })
        }
        function GetCity(ctx) {
            if (ctx == "" || ctx == null) {
                common.alertMessage("提交错误，请重试！");
                return;
            }

            data = ctx.ResponseList;

            var str = [];

            //var res = Enumerable.From(data);

            var result = Enumerable.From(data).ForEach(function (obj) {

                if (obj.Code == 0)
                    return;

                if (str.indexOf(obj.Code) >= 0)
                    return;

                str.push(obj.Code);

                $("#city").append("<option value='" + obj.Code + "'>" + obj.Name + "</option>")
            });
        }


        $(document).ready(function () {
            common.commonAjax({ type: 'get', url: '../api/student/ListArea', sMethod: GetCity });
            common.commonAjax({ type: 'get', url: '../api/student/ListSchool', sMethod: ListSchool });
            common.commonAjax({ type: 'get', url: '../api/Login/GetStatus', sMethod: AfterAjax });
            common.commonAjax({ type: 'get', url: '../api/student/ListBaseData', sMethod: ListBaseData });
            common.commonAjax({ type: 'get', url: '../api/student/ListAmount', sMethod: ListAmount });

        });

        function changeCity(pno) {

            $("#schoolNO").empty();

            if (pno == "0" || pno == "" || pno == undefined)
                return;

            Enumerable.From(lstSchool).Where("$.CityNO == " + pno + "").ForEach(function (obj) {
                $("#schoolNO").append("<option value='" + obj.SchoolNO + "'>" + obj.SchoolName + "</option>")
            })
        }

        function changeType(pno) {

            $("#typedetail").empty();

            if (pno == "0" || pno == "" || pno == undefined)
                return;

            Enumerable.From(lstType).Where("$.ParentNo == " + pno + "").ForEach(function (obj) {
                $("#typedetail").append("<option value='" + obj.RuleNO + "'>" + obj.Description + "</option>")
            })
        }

        function Listamunt() {
            Enumerable.From(lstAmout).ForEach(function (obj) {
                $("#amount").append("<option value='" + obj.RuleNO + "'>" + obj.Description + "</option>")
            })
        }

        //关闭宾果章程弹窗
        $("#reg-tamount-risk").on("click", function () {
            $(".mask").show();
            $("#rulesDetails").load("/wuc/rules.html");
        })
        $(".contractBox-title-close").on('click', function () {
            $(".mask,#rulesDetails").hide();
        });

    </script>
</body>
</html>
